package me.shiqiang.im.service;


import me.shiqiang.im.dao.ClientVersionDao;
import me.shiqiang.im.domain.ClientVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by John on 2018/5/18
 */
@Service
public class ClientVersionService {
    @Autowired
    private ClientVersionDao dao;

    public void changeClientVersion(String version, int forceUpdate) {
//        ClientVersion clientVersion = new ClientVersion();
        ClientVersion clientVersion = dao.findOne(1L);
//        clientVersion.setId(1L);
        clientVersion.setVersion(version);
        clientVersion.setForceUpdate(forceUpdate);
        dao.save(clientVersion);
    }

    public ClientVersion getClientVersion() {
        return dao.findOne(1L);
    }
}
